<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:fragment xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a4j="http://richfaces.org/a4j">
	<a4j:outputPanel ajaxRendered="true">
		<rich:panel styleClass="rich-stglpanel-body">
			<f:facet name="header">#{messages['label.unidades.operacionais']}</f:facet>
			
			<s:decorate template="/layout/edit.xhtml">
				<ui:define name="label">#{messages['label.comando']}</ui:define>
				<h:selectOneMenu 
					value="#{unidadeOperacionalAction.entity.unidadeComando}"
					style="width:300px;"
					label="#{messages['label.unidade.comando']}">
					<f:converter converterId="br.com.o2solutions.siso.webapp.converter.EntidadeBaseConverter"/>
					<s:selectItems 
						value="#{unidadeOperacionalAction.resultList}"
						var="_unidadeComando"
						label="#{_unidadeComando.descricao}"
						noSelectionLabel="#{messages['label.selecione']}"/>
				</h:selectOneMenu>
			</s:decorate>
			
			<s:decorate template="/layout/edit.xhtml">
				<ui:define name="label">#{messages['label.comandante']}</ui:define>
				<h:selectOneMenu 
					value="#{unidadeOperacionalAction.entity.comandante}"
					style="width:300px;">
					<f:converter converterId="br.com.o2solutions.siso.webapp.converter.EntidadeBaseConverter"/>
					<s:selectItems 
						value="#{unidadeOperacionalAction.resultList}"
						var="_comandante"
						label="#{messages['label.comandante']}"
						noSelectionLabel="#{messages['label.selecione']}"/>
				</h:selectOneMenu>
			</s:decorate>
			
			<s:decorate template="/layout/edit.xhtml">
				<ui:define name="label">#{messages['label.descricao']}</ui:define>
				<h:inputText 
					value="#{unidadeOperacionalAction.entity.descricao}" 
					label="#{messages['label.descricao']}" 
					required="true"
					size="70" 
					onkeyup="toUpperCase(this,'')">
				</h:inputText>
			</s:decorate>
			<s:link 
				rendered="#{!empty from}"
				view="#{from}"
				propagation="none">
				<h:graphicImage value="/img/undo-icon.png" alt="#{messages[label.voltar]}" title="#{messages[label.voltar]}"/>
			</s:link>
		</rich:panel>
		<s:decorate template="/layout/button.xhtml">
			<ui:param name="action" value="#{unidadeOperacionalAction}" />
			<ui:param name="renderedSave" value="#{unidadeOperacionalAction.entity.id==null}" />
			<ui:param name="renderedUpdate" value="#{unidadeOperacionalAction.entity.id!=null}" />
			<ui:param name="renderedRemove" value="#{unidadeOperacionalAction.entity.id!=null}" />
		</s:decorate>
	</a4j:outputPanel>
</ui:fragment>
